<?php
    //echo $this->Html->css(array('fullcalendar.css', 'jquery-ui-1.8.9.custom.css', 'screen.css', 'ie.css'),'stylesheet', array('media'=>'screen'));
	//echo $this->Html->script(array('jquery-1.4.4.min.js', 'jquery-ui-1.8.9.custom.min.js', 'fullcalendar.min.js', 'gcal.js'));
     //echo $this->Auth->user('id');
     $usertype = $_SESSION['Group'][0]['name'];
?>

<div id="eventdata"></div>
<script type="text/javascript">
$(document).ready(function() {


        $("#eventdata").hide();
		var date = new Date();
		var d = date.getDate();
		var m = date.getMonth();
		var y = date.getFullYear();


		$('#calendar').fullCalendar({

			header: {
				left: 'prev,next today',
				center: 'title',
				right: 'month,agendaWeek,agendaDay'
			},
            
            eventClick: function(calEvent) 
            {
                <?php if($usertype == 'Admin')
                { 
                    echo "window.open('jadmindetail/' + calEvent.id, '_self');";
                }
                else
                { 
                    echo "window.open('jdetail/' + calEvent.id, '_self');";
                } ?>
            },

            
            dayClick: function(date, allDay, jsEvent, view) 
            {
                if(allDay)
                {
                    $('#calendar').fullCalendar( 'changeView', 'agendaDay' );
                    $('#calendar').fullCalendar( 'gotoDate', date );
                }
            },
            
			editable: false,

			events: "<?php echo $this->Html->url('/jobs/feed/') ?>"

		});

	});
</script>


<?php
    //echo pr($_SESSION);
?>


<header>
    <ul class="action-buttons clearfix fr">
        <?php
            if($usertype == 'Admin')
            {
                echo "<li><a href='../jobs/jadminlist' class='button button-gray no-text' title='View the Task Calendar'>Task Calendar<span class='calendar'></span></a></li>";
            }
            else
            {
                echo "<li><a href='../jobs/jlistview' class='button button-gray no-text' title='View the Task Calendar'>Task Calendar<span class='calendar'></span></a></li>";
            }
        ?>
        <li><a href="documentation/index.html" class="button button-gray no-text help" rel="#overlay">Help<span class="help"></span></a></li>
    </ul>
    <h2>Task Calendar</h2>
</header>


<section>
    <div id='calendar' style='font-size:13px'></div>




        
        
        <div id="eventdata"></div>
    
</section>



<!--  old -->



        



            